package com.he.apps;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.he.models.User;

/**
 * 
 * TODO
 *
 * @author hesh
 * 2016年3月21日 - 下午3:47:27
 */
//@EnableAutoConfiguration
@RestController
@RequestMapping("/user")
public class UserController {
	@Value("${name}")
	private String name;

    @RequestMapping("/{id}")
    public User view(@PathVariable("id") Long id) {
        User user = new User();
        user.setId(id);
        user.setName("zhang");
        return user;
    }

	@RequestMapping("/")
	String home() {
		return String.format("Hello %s!", name);
	}

}

